package com.sunny;

/**
 * 返回结果工具类
 */
public class ResultUtils {
    
    public static <T> Result<T> success() {
        return Result.success();
    }
    
    public static <T> Result<T> success(T data) {
        return Result.success(data);
    }
    
    public static <T> Result<T> success(String message, T data) {
        return Result.success(message, data);
    }
    
    public static <T> Result<T> error() {
        return Result.error();
    }
    
    public static <T> Result<T> error(String message) {
        return Result.error(message);
    }
    
    public static <T> Result<T> error(int code, String message) {
        return Result.error(code, message);
    }
    
    public static <T> Result<T> error(ResultCode resultCode) {
        return Result.error(resultCode.getCode(), resultCode.getMessage());
    }
    
    public static <T> Result<T> build(int code, String message, T data) {
        return new Result<>(code, message, data);
    }
}